home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Apple Shared Library Manager / ASLM Examples / Inspector / Sources / Inspector.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-19  |  2.9 KB  |  112 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Inspector.h
  3.  
  4.     Contains:    Interface for a ASLM Test application.
  5.  
  6.     Copyright:    © 1991-1995 by Apple Computer, Inc., all rights reserved.
  7.  
  8. */
  9.  
  10. #ifndef __INSPECTOR__
  11. #define __INSPECTOR__
  12.  
  13. #ifndef __APPLICATION__
  14. #include "Application.h"
  15. #endif
  16.  
  17. #ifndef __LIBRARYMANAGERCLASSES__
  18. #include <LibraryManagerClasses.h>
  19. #endif
  20.  
  21. class TRegisteredObjectsWindow;
  22. class TRegisteredObjects;
  23. class TInspector;
  24. class TLibraryManager;
  25.  
  26. class TInspector;
  27.  
  28. const int    kMaxDocuments = 50;
  29. const int    kMaxTests = 50;
  30. const int    kWindowListStart = 6;    /* where the list of windows starts in the Windows menu */
  31. const int    kTestsListStart = 8;    /* where the list of tests starts in the Tests menu */
  32.  
  33. enum {kNoCmd, kReloadLibraryManagerCmd, kUnloadLibraryManagerCmd, kGotoSimpleProgramCmd};
  34.  
  35. const size_t kInspectorPoolSize = 25000;
  36.  
  37. #define kInspectorLibID "slm:tapp$,1.2"
  38.  
  39. /**********************************************************************
  40. ** class TInspector
  41. ***********************************************************************/
  42.  
  43. #define kTInspectorID "appl:insp$TInspector,1.2"
  44.  
  45. class TInspector : public TApplication
  46. {
  47. public:
  48.                                 _CDECL TInspector(QDGlobals* qdPtr, BooleanParm initToolbox = true);
  49.     virtual                        ~_CDECL TInspector();
  50.  
  51.     virtual    void                DoIdle();
  52.     virtual    void                AdjustMenus();
  53.     virtual    void                AdjustCursor();
  54.     virtual    void                DoMenuCommand(short menuID, short menuItem);
  55.     virtual    void                _CDECL DoNew(TRegisteredObjects*);    // called by ASLM
  56.     virtual    void                Terminate();
  57.  
  58.     // New Methods
  59.  
  60.     virtual    void                OpenPrefsFile();
  61.     virtual    void                ClosePrefsFile();
  62.     virtual    short                GetPrefsFileRefNum();
  63.     
  64.     virtual    void                RunTest(TClassID* testname);
  65.     
  66.             TScheduler*            GetUpdateListsScheduler();
  67.             short                GetLibraryManagerCmd();
  68.     
  69.     static    void                UnloadLibraryManager();
  70.     static    void                LoadLibraryManager();
  71.     static    int                    Main();
  72.     static    void                _CDECL DeathNotifierProc(TInspector* me, EventCode event, OSErrParm, TLibraryManager* libmgr);
  73.     static    void                Boot();
  74.     static    void                Cleanup();
  75.     
  76.     static    void                SimpleProgram();
  77.     static    void                SimpleDoEventLoop();
  78.     static    void                SimpleAdjustMenus();
  79.     static    void                SimpleDoMenuCommand(short menuID, short menuItem);
  80.  
  81. private:
  82.     short                fLibraryManagerCmd;
  83.     TScheduler*            fUpdateListsScheduler;
  84.     TDocument*            fWindowsMenuDocList[kMaxDocuments]; // documents in the Windows menu
  85.     TClassID*            fTestsMenuTestList[kMaxTests];     // tests in the Tests menu
  86.     size_t                fNumTests;
  87.     Boolean                fVerbose;
  88.     Boolean                fDebug;
  89.     Boolean                fDoLoad;
  90.     Boolean                fGrowPool;
  91.     long                fIterationCount;
  92.     Point                fNextWindowLocation;
  93.     short                fHTopWindowLocation;
  94.     short                fPrefsFileRefNum;
  95. };
  96.  
  97. /*    -----------------------------------------------------------------
  98.     inline methods
  99.     ----------------------------------------------------------------- */
  100.  
  101.     inline TScheduler* TInspector::GetUpdateListsScheduler()
  102.     {
  103.         return fUpdateListsScheduler;
  104.     }
  105.         
  106.     inline short TInspector::GetLibraryManagerCmd()
  107.     {
  108.         return fLibraryManagerCmd;
  109.     }
  110.  
  111. #endif
  112.